<?php

/* Print plain text input table */


echo "<table class=\"plain-input\">\n";
echo "<tr><td class=\"align-right\">";

/* Print table field names */
/* Print first field ID */
echo mysql_field_name($result, 0) . "</td>";
echo "<td>" . $plain[0] . "</td></tr>\n"; 
echo "<input type='hidden' name='aed_".mysql_field_name($result, 0) ."' value='". $plain[0] ."' />";

/* Print remainder fields */
echo "<tr><td class=\"align-right\">";
for ($i=1; $i < $fields; $i++) {
        echo "<span";
	if (mysql_field_name($result, $i)==$error_field){
		echo " class=\"error-field\" ";
	}
	echo ">" . mysql_field_name($result, $i);
	if (strpos(mysql_field_flags($result, $i), "not_null")!==false) {
		echo "*";
		$not_null_exist = true;
	}
	if (strpos(mysql_field_flags($result, $i), "multiple_key")!==false) {
		echo "~";
		$mult_key_exist = true;
	}
	if (strpos(mysql_field_flags($result, $i), "unique_key")!==false || strpos(mysql_field_flags($result, $i), "primary_key")!==false ) {
		echo "`";
		$unique_exist = true;
	}
	echo "</span><br />";
}
echo "</td>\n<td><textarea name=\"plain_text\" rows=\"" . ($fields) ."\"";
echo " cols=\"60\">";

/* Print table data values */
for ($i=1; $i < $fields; $i++) {
        if ($edit_selected!='' || $_POST['Submit']=='Plain Text Input' || $_POST['Submit']=='Plain Text Edit') {
		echo "\n". htmlspecialchars($plain[$i]);
        } else {
                echo "\n";
        }
}
echo "</textarea></td></tr>\n";
echo "</table>\n";

?>
